Field of the Invention
The present invention relates to an image processing apparatus and an image processing method, and in particular to a technique for encoding an image.
Description of the Related Art
A single plane image sensor provided with a color filter is used in a general digital camera. Also, the primary color Bayer pattern shown in FIG. 2 is known as one color distribution pattern of a color filter provided in the single plane image sensor. R (red), G1 (green), G2 (green), and B (blue) are periodically arranged, 2×2 pixels being one unit, in the primary color Bayer pattern. Because human vision is more sensitive to the luminance component than the color components, green pixels containing a larger luminance component than a red or blue pixel are arranged in a greater number than the red and blue pixels.
A signal that has been read out from the single plane image sensor has one color component per pixel. Such a signal format is called the RAW format, and RAW format data is called RAW data. Also, a signal obtained by classifying the signals of all of the pixels in terms of the corresponding color filter is called a pixel plane. If a color filter with the primary color Bayer pattern is used, the pixel signals are classified into an R plane, a G1 plane, a G2 plane, and a B plane. The pixel plane is also called a color plane, or a component.
Because RAW data has a large data amount, if the RAW data is recorded or transmitted, it has been known that the RAW data is encoded in order to reduce the data amount. In this case, in order to shorten the processing time, as with an encoder 800 shown in FIG. 8, for example, a configuration is possible in which a component converter 801 that separates the RAW data into pixel planes is provided, and four encoding units 802 encode respective pixel planes. For example, in the case of RAW data with the primary color Bayer pattern, the component converter 801 separates the RAW data into an R plane (C1), a G1 plane (C2), a G2 plane (C3), and a B plane (C4). The encoding units 802 respectively encode one pixel plane and output encoded data.
If the outputs of the four encoders 802 are connected to a shared data bus, in order to utilize the capability of the individual encoding units 802 to a maximum, it is important to allocate an appropriate output rate to the individual encoding unit 802 in accordance with the amount of encoded data that is to be generated. Japanese Patent Laid-Open No. 2003-132007 discloses a method for, in a digital camera in which a plurality of processing modules share a data bus, setting and managing timing and length of a time period during which the data bus can be used by each processing module.
The amount of encoded data generated in the individual encoding unit 802 may change depending on the type of signal that the encoding unit 802 encodes, the operation mode of the encoding unit, and the like, and thus it is important to dynamically control the rate of outputting the encoded data. However, in the method disclosed in Japanese Patent Laid-Open No. 2003-132007, the timing and the length of a time period during which the data bus can be used are fixed for each module, and thus the output rate of the module cannot be dynamically controlled. Therefore, the encode amount may be too high or too low in the allocated time period, and the encoding efficiency decreases.